package com.action.log;

import java.io.IOException;
import java.io.PrintWriter;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.beans.log.LogType;
import com.business.log.LogTypeBus;
import com.config.SystemGlobals;

public class EditLogType extends HttpServlet {

	private static final long serialVersionUID = 1L;
	
	public void doPost(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {
		String contentType = SystemGlobals.getValue("contentType");
		PrintWriter out = response.getWriter();
		response.setContentType(contentType);
		String logtypeId = request.getParameter("id");
		String logtypeName = request.getParameter("logtypename");
		String logtypeMemo = request.getParameter("logtypememo");
		String username = request.getParameter("username");
		LogType lt = new LogType();
		lt.setLogtypeMemo(logtypeMemo);
		lt.setLogtypeName(logtypeName);
		lt.setUsername(username);
		LogTypeBus ltb = new LogTypeBus();
		ltb.updateLogtype(lt, logtypeId);
		out
				.print("<script>alert(\"更新了日志分类\");window.location(\"user/showlist.jsp\");</script>");
		out.close();
	}

}
